/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ar.com.arkios.kfconTraductor;

import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

/**
 *
 * @author HERNAN
 */
public class MainCliente {

    private static Socket[] sockets = new Socket[5];
    
    public static void main(String [] args) throws Exception {
        /*
        for(int i = 0; i < 5; i++){
            sockets[i] = new Socket("localhost", 50777);
        }
        
        Thread.sleep(20000);
        */
        try {
            Socket socket = new Socket("localhost", 50777);
            String comando = "MAE:R SAP";
            DataOutputStream output = new DataOutputStream(socket.getOutputStream());
            output.writeInt(comando.length());
            output.write(comando.getBytes());
            byte[] resp = new byte[35];
            DataInputStream input = new DataInputStream(socket.getInputStream());
            input.read(resp);
            String respuesta = new String(resp);
            System.out.println(respuesta);
        } catch (IOException e) {
            System.out.print(e);
        }
    }
    
}
